<table id="list" class="scroll"></table>
<div id="pager" class="scroll" style="text-align:center;"></div>

<script type="text/javascript">
jQuery('#list').jqGrid({
	url:'/catalog/posts/list/format/json',
	datatype: 'json',
	mtype: 'GET',
	colNames:['Id', 'Product', 'Posted', 'Post', 'Author'],
	colModel :[
	  {name:'POST_ID', index:'POST_ID', sorttype:'int', width:50},
	  {name:'POST_PRODUCTID', index:'POST_PRODUCTID', editable:true, editrules:{required:true}, edittype:'select', editoptions:{value:{<?php foreach ($this->prods as $id => $title) echo "{$id}:'{$title}',"; ?>}}},
	  {name:'POST_POSTDATE', index:'POST_POSTDATE', editable:false},
	  {name:'POST_POST', index:'POST_POST', editable:true, edittype:'textarea', editrules:{required:false}, editoptions: {rows:"3",cols:"30"}},
	  {name:'POST_AUTHOR', index:'POST_AUTHOR', editable:false}
	],
	pager: jQuery('#pager'),
	rowNum:20,
	rowList:[20, 40, 60, 80, 100, 150, 200],
	sortname: 'POST_ID',
	sortorder: 'asc',
	viewrecords: true,
	caption: 'Brands View',
	editurl: '/catalog/posts/edit',
	height:'auto',
	width:'auto'
}).navGrid('#pager',{
	edit:true, add:true, del:true, search:true
});
</script>
